package(default_visibility = ["//visibility:public"])

load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library", "go_test")
load("//prow:def.bzl", "prow_image")

NAME = "sinker"

prow_image(
    name = "image",
    base = "@alpine-base//image",
    component = NAME,
    visibility = ["//visibility:public"],
)

go_binary(
    name = NAME,
    embed = [":go_default_library"],
    pure = "on",
)

go_test(
    name = "go_default_test",
    srcs = ["main_test.go"],
    embed = [":go_default_library"],
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/config:go_default_library",
        "//prow/flagutil:go_default_library",
        "//prow/kube:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/runtime:go_default_library",
        "@io_k8s_apimachinery//pkg/types:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/client/fake:go_default_library",
    ],
)

go_library(
    name = "go_default_library",
    srcs = ["main.go"],
    importpath = "k8s.io/test-infra/prow/cmd/sinker",
    deps = [
        "//prow/apis/prowjobs/v1:go_default_library",
        "//prow/config:go_default_library",
        "//prow/crier/reporters/gcs/kubernetes/api:go_default_library",
        "//prow/flagutil:go_default_library",
        "//prow/interrupts:go_default_library",
        "//prow/kube:go_default_library",
        "//prow/logrusutil:go_default_library",
        "//prow/metrics:go_default_library",
        "//prow/pjutil:go_default_library",
        "//prow/version:go_default_library",
        "@com_github_pkg_errors//:go_default_library",
        "@com_github_prometheus_client_golang//prometheus:go_default_library",
        "@com_github_sirupsen_logrus//:go_default_library",
        "@io_k8s_api//core/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/api/errors:go_default_library",
        "@io_k8s_apimachinery//pkg/apis/meta/v1:go_default_library",
        "@io_k8s_apimachinery//pkg/types:go_default_library",
        "@io_k8s_apimachinery//pkg/util/sets:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/client:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/log:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/log/zap:go_default_library",
        "@io_k8s_sigs_controller_runtime//pkg/manager:go_default_library",
    ],
)

filegroup(
    name = "package-srcs",
    srcs = glob(["**"]),
    tags = ["automanaged"],
    visibility = ["//visibility:private"],
)

filegroup(
    name = "all-srcs",
    srcs = [":package-srcs"],
    tags = ["automanaged"],
)
